package com.example.util;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@AllArgsConstructor
@Getter
@Setter
@ToString
public class ResultEntity<T> {

    private Integer code;    //当前请求处理结果状态码; 0: 成功

    private String msg; //错误消息

    private Integer count;  // 数据条数

    private T data; //返回的数据

    public static <E> ResultEntity<E> createResultEntity(Integer code, String msg, Integer count, E data) {
        return new ResultEntity<>(code, msg, count, data);
    }
}